﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

using DAL;
using BLL;

namespace WCF
{
    [ServiceContract]
    public interface IService
    {
        #region BatteryItem
        [OperationContract]
        BatteryItem GetBatteryItem(int ID);
        [OperationContract]
        void UpdateBatteryState(BatteryItem item, BatteryState state);
        [OperationContract]
        int UpdateBatteryItem(int ID, int _modelID, string stationName, BatteryState _state);
        [OperationContract]
        IEnumerable<BatteryItem> FindBatteryItemsAtLocationState(string location, double capacity, BatteryState state);
        #endregion
        #region BatteryStation
        [OperationContract]
        BatteryStation GetBatteryStationByID(int stationID);
        [OperationContract]
        BatteryCenter FindBatteryCenter(string name);
        #endregion
        #region BookingItem
        [OperationContract]
        IEnumerable<BookingItem> GetBookingItemsFromBooking(int bookingID);
        #endregion
        #region Booking
        [OperationContract]
        Booking GetBooking(int bookingID);
        [OperationContract]
        List<Booking> GetAllBookingsOfCustomer(int customerID);
        [OperationContract]
        int CreateBooking(int carID, List<BatteryCenterDistance> bcdList);
        [OperationContract]
        Dictionary<BatteryCenter, BatteryItem> ReserveBatteries(List<BatteryCenterDistance> listBCD, Car car);
        [OperationContract]
        void UnReserveBatteries(List<BatteryItem> listBatteryItem);
        [OperationContract]
        int CancelBooking(int bookingID);
        [OperationContract]
        bool CanCancelBooking(int bookingID);
        #endregion
        #region Car
        [OperationContract]
        Car GetCar(int carID);
        [OperationContract]
        IEnumerable<Car> GetAllCarsOwnedByCustomer(int customerID);
        [OperationContract]
        Car FindCarByLicencePlate(string licencePlate);
        [OperationContract]
        int CreateCar(double range, double capacity, int _customerID, string _licencePlate);
        [OperationContract]
        int UpdateCar(int ID, double range, double capacity, int _customerID, string _licencePlate);
        [OperationContract]
        int DeleteCar(int ID);
        #endregion
        #region Customer
        [OperationContract]
        Customer CheckLoginCredentials(string name, string password);
        #endregion
        #region Map
        [OperationContract]
        IList<BatteryCenter> GetAllCities();
        [OperationContract]
        BatteryCenter FindCity(string name);
        [OperationContract]
        List<BatteryCenterDistance> GetPathFromCityToCity(BatteryCenter from, BatteryCenter to, double carRange);
        #endregion
    }
}
